//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IShaderVariable.h>
///	@path	~/src/graphics/
///	@date	2007/11/15
///	@desc	Shader variable interface.

#pragma once

#include "xeres.h"

#include "object/IVar.h"

#include "graphics/IDevice.h"

namespace xeres {

	// forward declaration
	class ITexture;
	class IRenderTarget;

	/*!
		\class	IShaderVariable
		\brief	Presents an interface of accessing shader variable.

		\sa IEffect, ITechnique
	*/
	class IShaderVariable : public IVar
	{
	public:

		/// \name Constructor & Destructor
		//@{

		/// \ctor
		IShaderVariable( void );

		/// \dtor
		virtual ~IShaderVariable( void );

		//@}

		DECL_IOBJECT_INTERFACE( IShaderVariable , IVar );

	public:

		/// \name IShaderVariable Interface
		//@{

		/*!
			\brief		Get master object, IEffect or IEffectPool.
		*/
		virtual RefPass< IObject > GetMaster( void ) = 0;

		/*!
			\brief		Set shader variable value by IVar.
		*/
		virtual bool SetByVar( RefWeak< IVar > var ) = 0;

		/*! 
			\brief		Set shader variable value by raw data.
		*/
		virtual bool SetByData( const void * data , size_t bytes ) = 0;

		/*!
			\brief		Set shader variable value by ITexture.
		*/
		virtual bool SetByTexture( RefWeak< ITexture > texture ) = 0;

		/*!
			\brief		Set shader variable value by IRenderTarget.
		*/
		virtual bool SetByRenderTarget( RefWeak< IRenderTarget > rt ) = 0;

		//@}
	};
}